package com.xinqi.modules.prepare.common.mapper;

import com.xinqi.modules.prepare.common.dto.input.PrepareImportCoursewareData;
import com.xinqi.modules.prepare.common.dto.input.PrepareImportExamPaperData;
import com.xinqi.modules.prepare.common.dto.input.PrepareImportVideoData;
import com.xinqi.modules.prepare.question.dto.QuestionImportDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 备课区导入
 *
 * @author linkai
 * @date 2023/4/14
 */
@Mapper
public interface PrepareImportMapper {

    PrepareImportCoursewareData findCoursewareDataByIdAndType(@Param("id") Long id, @Param("contentType") Integer contentType);

    PrepareImportVideoData findVideoDataByIdAndType(@Param("id") Long id, @Param("contentType") Integer contentType);

    PrepareImportExamPaperData findExamPaperDataById(@Param("id") Long id);

    /**
     * 根据课件id查询切片
     *
     * @param contentId 课件id
     * @return List<PrepareCoursewarePartData>
     */
    List<PrepareImportCoursewareData.PrepareImportCoursewarePartData> findCoursePartListByContentId(@Param("contentId") Long contentId);

    /**
     * 根据视频id查询视频帧
     *
     * @param contentId 视频id
     * @return List<PrepareVideoPointData>
     */
    List<PrepareImportVideoData.PrepareImportVideoPointData> findVideoPointListByContentId(@Param("contentId") Long contentId);

    /**
     * 根据互动课件id和切片id列表查询试题
     *
     * @param contentId       互动课件id
     * @param resourcePartIds 切片id列表
     * @return List<CourseQuestionLibraryData>
     */
    List<QuestionImportDTO> findQuestionLibListByContentIdAndSourceIds(@Param("contentId") Long contentId, @Param("resourcePartIds") List<Long> resourcePartIds);

}
